/*
 * @Description: 
 * @Version: 2.0
 * @Autor: Seven
 * @Date: 2020-11-30 11:44:33
 * @LastEditors: Seven
 * @LastEditTime: 2020-12-15 14:00:33
 */
import request from '~/api/request';
// 获取课程导航
// type=1，线上课程 =2面授课程
export const getNavList = function(){
    return request({
        url: `/edu/course/classList`,
        method:'get',
    })
}

// 获取课程列表
// onlineType1.线上 2.线下
// subjectId课程大类id 语文、数学等
// page当前页码
// pageSize每页数量
export const geCourseList = function(onlineType,subjectId,page,pageSize){
    return request({
        url: `/edu/course/list`,
        method:'get',
        params:{
            onlineType,
            subjectId,
            page,
            pageSize
        }
    })
}

// 获取相关推荐
export const getRelevantCourse = function(){
    return request({
        url: `/relevantCourse`,
        method:'get'
    }).then(res=>{
        if(res.data.code === '0'){
            return res.data.data.list
        }
    })
}

// 获取视频凭证
export const getPlayAuth = function(id){
    return request({
        url: `/pc/course/getPlayAuth/${id}`,
        method:'post'
    })
}
